export default {
  v_name: 'backgroundImg',
  v_fun: {
    inserted: function (el, binding) {
      var color = Math.floor(Math.random() * 1000000)
      el.style.backgroundColor = '#' + color
      var img = new Image()
      img.src = binding.value
      img.onload = function () {
        el.style.backgroundImage = 'url(' + binding.value + ')'
      }
    }
  }
}
